# -*- coding:utf-8 -*-
# @Time: 2020/7/17 16:50
# @Author: liupengfei
# @File: __init__.py.py

from rest_framework.views import APIView
from utils import response_ok


class MenuView(APIView):
    def post(self, request, *args, **kwargs):
        menu = [
            {
                'name': '仪表盘',
                'icon': 'dashboard',
                'path': '/dashboard',
            },
            {
                'name': '日记管理',
                'icon': 'desktop',
                'path': '/diary',
                'children': [
                    {
                        'name': '日志列表',
                        'path': '/diary/',
                    }
                ]
            },
            {
                'name': '系统管理',
                'icon': 'desktop',
                'path': '/system',
                'children': [
                    {
                        'name': '分类管理',
                        'path': '/system/category/',
                    },
                    {
                        'name': '标签管理',
                        'path': '/system/label/',
                    }
                ]
            }
        ]
        return response_ok(menu)
